package com.blacktea.cloudapicommon.beans;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description:
 * @author: black tea
 * @date: 2021/7/28 10:48
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonResult<T> {

    private Integer code;
    private String message;
    private T data;

    public CommonResult(Integer code,String message){
        this(code,message,null);
    }

    public static CommonResult Result(boolean result){
      return result ? new CommonResult(200,"成功",result): new CommonResult(500,"失败",result);
    }

}
